package com.riwon.im.common.constant;

/**
 * @author wpy
 * @date 2018/5/10 9:42
 */
public class UserConstant {

    /**
     * 微官网的appid
     */
    public static final String WAPSITE_APPID = "wapsite";

    public enum  State{
        ONLINE(1,"在线"),
        OFFLINE(2,"离线"),
        DELETE(-1,"删除"),
        ;

        private int code;
        private String dsc;

        State(int code, String dsc) {
            this.code = code;
            this.dsc = dsc;
        }

        public int getCode() {
            return code;
        }

        public String getDsc() {
            return dsc;
        }

        public static State getByCode(Integer code){
            for (State type : State.values()) {
                if(type.getCode() == code){
                    return type;
                }
            }
            return null;
        }
    }

    public enum Type{
        USER(1,"客服"),
        MEMBER(2,"会员"),
        TOURIST(3,"游客"),
        ;

        private int code;
        private String dsc;

        Type(int code, String dsc) {
            this.code = code;
            this.dsc = dsc;
        }

        public int getCode() {
            return code;
        }

        public String getDsc() {
            return dsc;
        }

        public static Type getByCode(Integer code){
            for (Type type : Type.values()) {
                if(type.getCode() == code){
                    return type;
                }
            }
            return null;
        }
    }
}
